<?php

namespace app\caches;

use app\model\sdk\AdPlan;

class AdPlanCache extends CacheBase
{
    /**
     * 缓存前缀
     * @var string
     */
    protected $prefix = 'AdPlan';

    /**
     * 读取真实数据，此接口只能由 remember 来回调
     * @param  string|array $key 检索key
     * @return mixed
     */
    protected function getReal($key = '')
    {
        $plan = AdPlan::find($key);
        if (empty($plan)) {
            return [];
        }

        return $plan->toArray();
    }
}
